package 蓝桥真题;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class 明码 {
	   static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));   
	
	   static void print(short x){
		      for(int i=15;i>=0;i--){
		    	  System.out.print(x>>i&1);
		      }
	   }
	   public static void main(String[]args) throws IOException{
	          for(int i=0;i<10;i++){
	        	  String[]ss=br.readLine().split(" ");
	        	  for(int j=0;j<16;j++){
	        		  for(int k=0;k<2;k++){
	        			  short be=Short.parseShort(ss[j*2+k]);
	        			  print(be);
	        		  }
	        		  System.out.println();
	        	  }
	        	  System.out.println();
	          }
       }
} 